<html>
    <head>
        <title>Sales</title>
        <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
		<link rel="stylesheet" type="text/css" media="all" href="datechooser.css">
	

    </head>
    <body>
    	
        <div id="logo">
            <h1><a href="#">Sales</a></h1>
        </div>
        <form id='saleform' onsubmit="handleSubmit(); return false;">
        	
            <input type='hidden' id='saleid' name='saleid' value='0' /><input type='hidden' id='customerid' name='customerid' value='1' />
			
            <table width='200px' border='1'>
                <tr>
                    <td>
                        <input type='button' id='infobutton' class='buttons' onclick='ChangeTab(0);' value='Info'>
                    </td>
                    <td>
                        <input type='button' id='itemsbutton' onclick='ChangeTab(1);' value='Items(0)' />
                    </td>
                    <td>
                        <input type='button' id='searchbutton' onclick='ChangeTab(2);' value='Payments' />
                    </td>
                    
                </tr>
            </table>
            <div id='datepad' name='datepad' style='display:none;'></div>
			 <div id='numpad' name='numpad' style='display:none;'></div>
            <div id='iteminfo' name='iteminfo' style='display:none;'>
                <input type='hidden' id='editingindex' name='editingindex'>
                <table class='field'>
                    <tr>
                        <td class='field' id='itemdescription' style='text-align:center;' colspan='2'>
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                            Item Cost:
                        </td>
                        <td class='field2'>
                            <input type='text' id='itemcost' style='width:80px' name='itemcost' onfocus='ShowNumPad(this,3);' value='' />
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                            Item Price:
                        </td>
                        <td class='field2'>
                            <input type='text' id='itemprice' style='width:80px' name='itemprice' onfocus='ShowNumPad(this,3);' value='' />
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                            Quantity:
                        </td>
                        <td class='field2'>
                            <input type='button' style='width:18px;' id='delqty' onclick='AddOne("itemqty",-1);' value='-' /><input type='button' id='addqty' value='+' style='width:18px;' onclick='AddOne("itemqty",1);'/><input type='text' id='itemqty' style='width:30px' name='itemqty' value='' />
                        </td>
                    </tr>
                    <tr>
                        <td class='field' colspan='2' style='text-align:right;'>
                            <input type='button' onclick='SaveItemDetails();' value='Save'><input type='button' onclick='DeleteItem(document.all.editingindex.value);' value='Delete'><input type='button' onclick='ChangeTab(1);' value='Cancel'>
                        </td>
                    </tr>
                </table>
            </div>
            <div id='infotab' name='infotab' style='display:none;'>
			    <table class='field'>
                    <tr>
                        <td class='field'>
                            Date:
                        </td>
                        <td class='field2' >
                            <!--<input type='text' id='saledate' name='saledate'  style='width:110px' value='' />-->
							<input id="saledate" style='width:100px;margin-left:6px' type="text" value=""><img src='datechooser.png' onclick='ShowDatePad(document.all.saledate,0);'>
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                            Customer:
                        </td>
                        <td class='field2'>
                            <input type='text' readonly id='customer' name='customer' value='Cash' /><a href='#' onclick='ChangeTab(4);'>[Change]</a>
                        </td>
                    </tr>
                </table>
				<div class='field' style='height:50px'>
                    Memo:<input type='text' style='width:170px;height:50px' id='memo' name='memo' value='' />
                </div>
            </div>
                <div id='customersearch' name='customersearch'  style='display:none;'>
                    <table class='field'>
                        <tr>
                            <td class='field'>
                                Search:
                            </td>
                            <td class='field2'>
                                <input type='text' id='searchc' name='searchc'>
                            </td>
                        </tr>
                        <tr>
                            <td class='field' colspan='2'>
                                <input type='button' class='buttons' value='Search' onclick='SearchCustomer(document.all.searchc.value,0);'/><input type='button' class='buttons' value='Cancel' onclick='ChangeTab(1);'/><input type='button' class='buttons' value='Cash' onclick='Load(0);'/>
                            </td>
                        </tr>
                    </table><span id="searchresult">&nbsp;</span>
                </div>
                
            <div id='itemstab' name='itemstab'  style='display:none;'>
                <div class='field' style=' text-align:center'>
                    Items
                </div>
                <span id='itemspan'></span>
            </div>
            <div id='paytab' name='paytab' style='display:none;'>
                <div class='field' style=' text-align:center'>
                    Payments
                </div>
                <table class='field'>
                    <tr>
                        <td class='field'>
                            <a href=# onclick='ChangePay(document.all.cash,0,true);'>Cash:</a> 
                        </td>
                        <td class='field2'>
                            <input type='text' id='cash' style='width:80px' name='cash' value='0.00' onchange="ChangePay(this,this.value,false);" onfocus='ShowNumPad(this,2);' />
                        </td>
                    </tr>
                    <tr>
                        <td class='field' colspan='2'>
                            <input type='button' class='buttons' value='$50' onclick='ChangePay(document.all.cash,50, false);'/><input type='button' class='buttons' value='$20' onclick='ChangePay(document.all.cash,20, false);'/><input type='button' class='buttons' value='$10' onclick='ChangePay(document.all.cash,10, false);'/><input type='button' class='buttons' value='$5' onclick='ChangePay(document.all.cash,5, false);'/>
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                             <a href=# onclick='ChangePay(document.all.check,0,true);'>Check:</a> 
                        </td>
                        <td class='field2'>
                            <input type='text' id='check' style='width:80px' name='check' value='0.00' onchange="ChangePay(this,this.value,false);" onfocus='ShowNumPad(this,2);'"/>
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                             <a href=# onclick='ChangePay(document.all.credit,0,true);'>Credit:</a> 
                        </td>
                        <td class='field2'>
                            <input type='text' style='width:80px' id='credit' name='credit' value='0.00' onchange="ChangePay(this,this.value, false);" onfocus='ShowNumPad(this,2);'/>
                        </td>
                    </tr>
                    <tr>
                        <td class='field'>
                            <a href=# onclick='ChangePay(document.all.account,0,true);'> Account:</a> 
                        </td>
                        <td class='field2'>
                            <input type='text' style='width:80px' id='account' name='account' value='0.00' onchange="ChangePay(this,this.value, false);" onfocus='ShowNumPad(this,2);'/>
                        </td>
                    </tr>
                    <tr>
                        <td class='field' style='background:#ffcb95;color:#0c2791;'>
                            Balance:
                        </td>
                        <td class='field2'>
                            <input type='text' style='width:80px;' id='balance' name='balance' value='0.00' readonly/>
                        </td>
                    </tr>
                </table>
                <div class='field'>
                    <input type='button' class='buttons' value='Finish' onclick='FinishSale(1);'/><input type='button' class='buttons' value='Exit' onclick='FinishSale(2);'/>
                </div>
            </div>
        </form><!-- ====================================== -->
        <!-- End HTML code.  Begin JavaScript code. -->
		
        <script type="text/javascript" src="gears_init.js">
        </script>
        <script type="text/javascript" src="scripts.js">
        </script>
        <script type="text/javascript" src="sales.js">
        </script>
		


        <!-- <xml id="xmlTitles" src="./Sales.xml?root='Sales'">
        </xml>-->
    </body>
</html>
